def mkp =  new groovy.xml.MarkupBuilder()

// write mark-up
mkp.authors {
       author( name:'Stephen King'){
               book( title: 'The shininig')
               book( title: 'Cujo' )
       }
       author( name: 'James Patterson'){
               book( title: 'Along Came a Stpider')
       }
}